Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Object sizing
You can size an object, depending on its object type and data type, using either the various height and width attributes or the
FORMATattribute. Because of the imprecise nature of width calculations for values displayed in variable-width fonts, you might have to adjust either the format or the width to be appropriate for the values you’re displaying. This is no different than for static objects in a graphical environment. Be aware that aFORMATof“X(20)”is not necessarily the same width in terms of screen real estate as aWIDTH-CHARSof20. Generally, Progress uses a formula for calculating a format that is slightly more generous (that is, yields a slightly greater width) than the formula for calculating the width fromWIDTH-CHARS. Some amount of trial and error might be necessary to arrive at the right format or width for the type of data typically displayed in a field. Capital letters, for example, are on average much wider than lowercase letters, so a field that is displayed all in capitals likely needs a greater width than a lowercase or mixed-case field.The sample code in the "Using the FONT-TABLE to make the labels colon-aligned" section provides an example of using a built-in system handle called
FONT-TABLEto calculate the display width of a specific string in a specific font, which you can also use to assign an appropriate width.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |